app.service('userService', function ($http) {



    //初始化数据选课
    this.initUser = function () {
        return $http.get('../user/findUserId.do');
    }
    //初始化数据选课
    this.findOne = function (uid) {
        return $http.get('../user/findUserById.do?id=' + uid);
    }

    //获得所有用户
    this.findAll = function () {
        return $http.get('../user/getStudents.do');
    }


    //获得用户名
    this.showName = function () {
        return $http.get('../user/showName.do');
    }


    //用户登录
    this.login = function (entity) {

        return $http.post('../user/login.do', entity);
    }

    //用户注销
    this.logout = function () {
        return $http.get('../user/logout.do');
    }

    //用户注册
    this.regist = function (entity) {
        return $http.post('../user/regist.do', entity);
    }
    //站内搜索
    this.search = function (searchEntity) {
        return $http.post('../user/findUserFuzzy.do', searchEntity);
    }
});